﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:types="clr-namespace:Assembly.Metro.Controls.PageTemplates.Games.Components.MetaData"
                    xmlns:MetaComps="clr-namespace:Assembly.Metro.Controls.PageTemplates.Games.Components.MetaComponents">
    <DataTemplate DataType="{x:Type types:Uint8Data}">
        <MetaComps:intValue Opacity="{Binding Opacity}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type types:Int8Data}">
        <MetaComps:intValue Opacity="{Binding Opacity}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type types:Uint16Data}">
        <MetaComps:intValue Opacity="{Binding Opacity}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type types:Int16Data}">
        <MetaComps:intValue Opacity="{Binding Opacity}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type types:Uint32Data}">
        <MetaComps:intValue Opacity="{Binding Opacity}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type types:Int32Data}">
        <MetaComps:intValue Opacity="{Binding Opacity}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type types:Float32Data}">
        <MetaComps:intValue Opacity="{Binding Opacity}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type types:VectorData}">
        <MetaComps:VectorValue Opacity="{Binding Opacity}"/>
    </DataTemplate>

    <DataTemplate DataType="{x:Type types:StringIDData}">
        <MetaComps:StringIDValue Opacity="{Binding Opacity}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type types:CommentData}">
        <MetaComps:Comment Opacity="{Binding Opacity}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type types:StringData}">
        <MetaComps:AsciiValue Opacity="{Binding Opacity}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type types:DataRef}">
        <MetaComps:rawBlock Opacity="{Binding Opacity}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type types:RawData}">
        <MetaComps:rawBlock Opacity="{Binding Opacity}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type types:TagRefData}">
        <MetaComps:tagValue Opacity="{Binding Opacity}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type types:BitfieldData}">
        <MetaComps:Bitfield Opacity="{Binding Opacity}"/>
    </DataTemplate>
    <DataTemplate DataType="{x:Type types:EnumData}">
        <MetaComps:Enumeration Opacity="{Binding Opacity}"/>
    </DataTemplate>
    
    <DataTemplate DataType="{x:Type types:ReflexiveData}">
        <MetaComps:MetaChunk HorizontalAlignment="Left" Opacity="{Binding Opacity}" />
    </DataTemplate>
    
    <DataTemplate DataType="{x:Type types:WrappedReflexiveEntry}">
        <!-- Moving this into a UserControl causes severe lag for some reason :S -->
        <Grid>
            <Border Width="{Binding Width}" HorizontalAlignment="Left" VerticalAlignment="Stretch" BorderBrush="#474747" Opacity="{Binding Opacity}">
                <Border.Style>
                    <Style TargetType="Border">
                        <Setter Property="Margin" Value="0" />
                        <Setter Property="BorderThickness" Value="1,0,1,0" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsLast}" Value="True">
                                <Setter Property="Margin" Value="0,0,0,10" />
                                <Setter Property="BorderThickness" Value="1,0,1,1" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </Border.Style>
            </Border>
            <ContentControl Content="{Binding WrappedField}"
                            HorizontalAlignment="Left">
                <ContentControl.Style>
                    <Style TargetType="ContentControl">
                        <Setter Property="Margin" Value="20,0,0,0" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsLast}" Value="True">
                                <Setter Property="Margin" Value="20,0,0,20" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </ContentControl.Style>
            </ContentControl>
        </Grid>
    </DataTemplate>
</ResourceDictionary>